package solution;

import hex.HexState;
import solution.HexPlayer;

public class Offense {
	static int startX = 4;
	static int startY = 5;
	public static Point getNextPoint(HexState hs){
		if(HexPlayer.turnNum == 0)
			return(new Point(startX,startY));
		
		if(isClear(new Point(startX+HexPlayer.turnNum-1,startY+2*HexPlayer.turnNum-2),new Point(startX+HexPlayer.turnNum,startY+2*HexPlayer.turnNum)).equals(new Point(-1,-1)) && startY+2*HexPlayer.turnNum-2 != 10)
			return(new Point(startX+HexPlayer.turnNum,startX+2*HexPlayer.turnNum));
		
		if(isClear(new Point(startX-HexPlayer.turnNum-3,startY-2*HexPlayer.turnNum-6),new Point(startX-HexPlayer.turnNum-2,startY-2*HexPlayer.turnNum-4)).equals(new Point(-1,-1)) && startY-2*HexPlayer.turnNum-2 != 0)
			return(new Point(startX-HexPlayer.turnNum-2,startY-2*HexPlayer.turnNum-4));
		
		if(isClear(new Point(1,0),new Point(6,10)).equals(new Point(-1,-1)))
			return new Point(startX,startY+1);
			
		if()
		return new Point(-1,-1);
	}
	private Point isClear(HexState hS, Point startPoint, Point endPoint) {
	       Rope r = new Rope(startPoint, endPoint);
	       for (Point p : r.inBetweens)
	           if (hS.board[p.x][p.y]==HexState.awaySym)
	               return p;
	       return new Point(-1, -1);
}
